using System;
using System.Collections.Generic;
using System.Text;

namespace TidhiGanitam.DataModel
{
    public class VarjyamuDetails
    {
        double m_NakshatramuIndex;
        Rasi m_VarjyamuTime;
        Rasi m_Tyajyamu;
        Rasi m_VarjyamuEndTime;
        Enums.VarjyamuTime m_VarjyamuSamayamu;

        public double NakshatramuIndex
        {
            get
            { return m_NakshatramuIndex; }
            set
            { m_NakshatramuIndex = value; }
        }
        public string Varjyamu
        {
            get
            { return m_VarjyamuSamayamu.ToString() + " " + m_VarjyamuTime.DisplayFormat(Enums.DisplayFormat.LV) +
              " [" + Constants.Nakshatramu[Convert.ToInt32(NakshatramuIndex)].ToString() + "]";
        }
        }
        public string Tyajyamu
        {
            get
            { return "Tya " + m_Tyajyamu.DisplayFormat(Enums.DisplayFormat.LV) ; }
        }
        public Rasi VarjyamuTime
        {
            get
            { return m_VarjyamuTime; }
            set
            { m_VarjyamuTime = value; }
        }
        public Rasi TyajyamuTime
        {
            get
            { return m_Tyajyamu; }
            set
            { m_Tyajyamu = value; }
        }
        public Rasi VarjyamuEndTime
        {
            get
            { return m_VarjyamuEndTime; }
            set
            { m_VarjyamuEndTime = value; }
        }
        public Enums.VarjyamuTime VarjyamuSamayamu
        {
            get
            { return m_VarjyamuSamayamu; }
            set
            { m_VarjyamuSamayamu = value; }
        }
        public VarjyamuDetails()
        {
            m_NakshatramuIndex = 0;
            m_VarjyamuTime = new Rasi();
            m_Tyajyamu = new Rasi();
            m_VarjyamuSamayamu = Enums.VarjyamuTime.Di_Vi;
        }
        public string GetVarjyamuDetailsString(Rasi Suryodayamu)
        {
            string retString = string.Format("{0}.{1} tya:{2} ({3} La {4})",
                VarjyamuSamayamu, 
                VarjyamuTime.DisplayFormat(Enums.DisplayFormat.LV),
                TyajyamuTime.DisplayFormat(Enums.DisplayFormat.LV),
                VarjyamuTime.GetTimeFormatString(new Rasi(Suryodayamu), true),
                VarjyamuEndTime.GetTimeFormatString(new Rasi(Suryodayamu), false));
            return retString;
        }

    }
}
